package com.lottery.material.exception;

import com.lottery.material.enums.ResultEnum;
import lombok.Getter;

/**
 * Description：自定义异常
 * Created by 朱正磊 on 2019-04-03 16:44
 */
@Getter
public class ResponseException extends RuntimeException {

    private static final long serialVersionUID = 1391334353882554421L;

    private Integer code;

    public ResponseException(ResultEnum resultEnum) {
        super(resultEnum.getMessage());
        this.code = resultEnum.getCode();
    }

    public ResponseException(Integer code, String message) {
        super(message);
        this.code = code;
    }

}
